<?php

use yii\helpers\Html;
use yii\grid\GridView;
use common\models\PostStatus;
use common\models\Adminuser;
/* @var $this yii\web\View */
/* @var $searchModel common\models\PostSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

<<<<<<< HEAD
$this->title = '文章管理';
=======
$this->title = 'Posts';
>>>>>>> 028a9e1ed35c5e94b64c6b6feb0151fb63c3eadc
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="post-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('新建文章', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
<<<<<<< HEAD
//          ['class' => 'yii\grid\SerialColumn'],//序列号
=======
<<<<<<< HEAD
            ['class' => 'yii\grid\SerialColumn'],//序列号

            'id',
            'title',
            'author_id',
//          'content:ntext',
            'tags:ntext',
            'status',
            // 'create_time:datetime',
            'update_time:datetime',
          
=======
            ['class' => 'yii\grid\SerialColumn'],
>>>>>>> e09e6def5f80029b1fbfa0ca36aa17d488e8162e

            ['attribute'=>'id',
            'contentOptions'=>['width'=>'30px'],
            ],//设置宽度
            'title',
            ['attribute'=>'authorName',
            'label'=>'作者',
             'contentOptions'=>['width'=>'70px'],
             'value'=>'author.nickname',
            
            ],
//          'content:ntext',
            'tags:ntext',
//          'status',
            ['attribute'=>'status',
             'value'=>'status0.name',
             'filter'=>PostStatus::find()
                       ->select(['name','id'])
                       ->orderBy('position')
                       ->indexBy('id')
                       ->column(),
            ],
            // 'create_time:datetime',
<<<<<<< HEAD
            ['attribute'=>'update_time',
            'format'=>['date','php:Y-m-d H:i:s'],
            ],
         
=======
            // 'update_time:datetime',
            // 'author_id',
>>>>>>> 028a9e1ed35c5e94b64c6b6feb0151fb63c3eadc
>>>>>>> e09e6def5f80029b1fbfa0ca36aa17d488e8162e

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
